package com.supreme.nettyapp.generalclient.beatclient;

import com.supreme.nettyapp.generalclient.beatclient.service.BeatClientService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

//@Component
@ConditionalOnProperty(prefix = "netty.beat-client", name = "enabled", havingValue = "true")
public class BeatClientStarter {

    @Resource
    private BeatClientService beatClientService;

    @PostConstruct
    private void beatClientStarter() {
        beatClientService.startNettyClient("localhost", 7314);
//        beatClientService.startNettyClient("localhost", 7324);
    }
}
